<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../resources/jquery-easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="../../resources/jquery-easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="../../resources/jquery-easyui/demo/demo.css">
    <!--<%&#45;&#45;<link rel="stylesheet" type="text/css" href="lib/jquery-easyui/demo.css">&#45;&#45;%>-->
    <script type="text/javascript" src="../../resources/jquery-easyui/jquery.min.js"></script>
    <script type="text/javascript" src="../../resources/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../../resources/admin/urlAdmin.js"></script>
</head>
<body class="easyui-layout">
<div data-options="region:'north',border:false" style="height:60px;background:#B3DFDA;padding:10px;text-align: center;font-size: 20px">POS机升级管理系统</div>
<div data-options="region:'west',split:true,title:'菜单'" style="width:150px;padding:10px;">

    <!--<div style="margin-bottom:10px">-->
        <!--<a href="#" onclick="javascript:$('#tt').etree('create')">Create</a>-->
        <!--<a href="#" onclick="javascript:$('#tt').etree('edit')">Edit</a>-->
        <!--<a href="#" onclick="javascript:$('#tt').etree('destroy')">Destroy</a>-->
    <!--</div>-->
    <ul id="tt"></ul>
</div>
<div data-options="region:'east',split:true,collapsed:true,title:'East'" style="width:100px;padding:10px;">east region</div>
<div data-options="region:'south',border:false" style="height:50px;background:#A9FACD;padding:10px;">south region</div>
<div data-options="region:'center',title:'Center'">
    <div id="tabs" class="easyui-tabs" style="width:100%;height:800px;">

        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    $(document).ready(function(){

//此处是easyui调用tree组件的方法(使用easyui的童鞋自然懂得，只需修改请求json的api即可)
        $('#tt').tree({
            url: netpath+'/menu/list',
            method:'get',
            loadFilter: function(data){
                return data.data;
            },
            onClick:function(node){
//                alert(node.id);
                openTab(node.text,netpath+node.attributes)
            },
            onBeforeExpand:function(node){
                $('#tt').tree('options').url = netpath+"/menu/getChildMenu?pid="+ node.id;
            }

        });
    });

    /**
     * 打开table页，显示数据
     * @param title
     * @param href
     */
    function openTab(title,href) {
        var e = $('#tabs').tabs('exists', title);
        if (e) {
            $("#tabs").tabs('select', title);

            var tab = $("#tabs").tabs('getSelected');
            $('#tabs').tabs('update', {
                tab: tab,
                options: {
                    title: title,
                    content:
                    '<iframe name="indextab" scrolling="auto" src="' + href + '" frameborder="0" style="width:100%;height:100%;">' +
                    '</iframe>',
                    closable: true,
                    selected: true
                }
            });
        } else {
            $('#tabs').tabs('add', {
                title: title,
                content: '<iframe name="indextab" scrolling="auto" src="' + href + '" frameborder="0" style="width:100%;height:100%;"></iframe>',
                iconCls: '',
                closable: true
            });
        }
    }

    /**
     * 请求得到table数据,所有用户
     */
  var getAllUsers= function(url) {

    }

</script>
</html>